#include <iostream>
using namespace std;

class A{};
class B:public A{};

int main (void)
{
	try {
		throw A();
		//throw B();
	}
	catch (B& ex) {
		cout << "捕获到异常B" << endl;
		return -1;
	}
	catch (A& ex) {
		cout << "捕获到异常A" << endl;
		return -1;
	}
	return 0;
}
